//
//  XRSegmentControl.h
//  XRLoopSegmentControl
//
//  Created by TQS on 15/4/11.
//  Copyright (c) 2015年 寒竹子. All rights reserved.
//

/**
 * @brief  XRSegmentControl 视图切换控制器 (V2.0)
 *
 * @date   2015-04-22 22:10:34
 * @author 寒竹子
 */

#define SelectedIndexChanged_Notification @"SelectedIndexChanged_Notification"

#import <UIKit/UIKit.h>

@protocol  XRSegmentControlDelegate<NSObject>

@required

- (void)segmentSelectedIndexChanged:(NSInteger)selectedIndex;

@end

@interface XRSegmentControl : UIView

@property (nonatomic, strong) UIFont * textFont;
@property (nonatomic, strong) UIColor * normalColor;
@property (nonatomic, strong) UIColor * selectedColor;
@property (nonatomic, strong) UIImage * image;
@property (nonatomic, strong) UIColor * backgroundColor;
@property (nonatomic, assign) CGFloat barHeight;
@property (nonatomic, strong) id <XRSegmentControlDelegate> delegate;
@property (nonatomic, assign) NSInteger defaultIndex;

- (instancetype)initWithFrame:(CGRect)frame
                       titles:(NSArray *)titles
                     delegate:(id)delegate
                     textFont:(UIFont *)textFont
              normalTextColor:(UIColor *)normalColor
                selectedColor:(UIColor *)selectedColor
                    barHeight:(CGFloat)barHeight
                        image:(UIImage *)image
              backgroundColor:(UIColor *)backgroundColor
                 defaultIndex:(NSInteger)defaultIndex;

@end
